package cn.kgm.makeGodV2.ruleEngine;

import java.util.HashMap;
import java.util.Map;

/**
 * @Version 1.8
 * @Author: Kappi
 * @Date: 2025-9-24 10:27
 * @Description: cn.kgm.makeGodV2.ruleEngine.RealmCheckRule
 */
// 境界检查规则
public class RealmCheckRule implements RuleStrategy<Boolean> {
    private static final Map<String, Integer> REALM_LEVELS = createRealmLevels();

    private static Map<String, Integer> createRealmLevels() {
        Map<String, Integer> levels = new HashMap<>();
        levels.put("练气期", 1);
        levels.put("筑基期", 2);
        levels.put("金丹期", 3);
        levels.put("元婴期", 4);
        levels.put("化神期", 5);
        levels.put("大乘期", 6);
        return levels;
    }

    @Override
    public String getRuleType() {
        return "REALM_CHECK";
    }

    @Override
    public boolean validate(RuleContext context) {
        return context.getParam("playerRealm") != null;
    }

    @Override
    public RuleResult<Boolean> execute(RuleContext context) {
        // 这个实现只处理简单的境界检查
        // 复杂逻辑已经在ConditionExecutor中处理
        String playerRealm = context.getParam("playerRealm", String.class);
        return RuleResult.success("境界检查完成", true);
    }

    @Override
    public int getPriority() {
        return 1;
    }
}

